 //发现页接口

import {http} from '@/utils/httpRequest'

//提交图片接口

 export const postPutImages = (data) => {
	return new Promise((resolve, reject) => {
		 uni.uploadFile({
			url: '/wx/v1/post/putImages', //仅为示例，非真实的接口地址
			filePath: data,
			name: 'file_data',
			success: (res) => {
				let result= JSON.parse(res.data)
				console.log(result.data[0].id);
			},
			fail: (error) => {
				console.log(error);
			}
		});
	});
};

// 创建帖子接口
export const postPublishPost = (data:Object) => {
	return http({
		url: '/wx/v1/post/create',
		method: 'POST',
		data,
	});
};


// 搜索帖子
export const postSearchPost = (data) => {
	let url = '/wx/v1/post/search';  
    return http({
        method: 'POST',
        url: url,
		data
    })
}